package com.difsonapps.contacttranslator.service.impl;

import java.util.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.difsonapps.contacttranslator.dao.EventDAO;
import com.difsonapps.contacttranslator.dto.EventDTO;
import com.difsonapps.contacttranslator.service.itf.EventService;


@Repository
@Transactional
public class EventServiceImpl implements EventService {
	@Autowired
	protected EventDAO eventDAO;

	@Transactional
	public void insert(EventDTO eventDTO) {
		eventDAO.insert(eventDTO);
	}

	@Transactional
	public void update(EventDTO eventDTO) {
		eventDAO.update(eventDTO);
	}

	@Transactional
	public EventDTO get(int id) {
		return eventDAO.get(id);
	}

	@SuppressWarnings("unchecked")
	@Transactional
	public List<EventDTO> getAll() {
		return eventDAO.getAll();
	}

	@Transactional
	public void delete(EventDTO eventDTO) {
		eventDAO.delete(eventDTO);
	}

	public List<EventDTO> getByLastId(int lastId, int limit) {
		// TODO Auto-generated method stub
		return eventDAO.getByLastId(lastId, limit);
	}

	public List<EventDTO> getLimit(int limit) {
		// TODO Auto-generated method stub
		return eventDAO.getLimit(limit);
	}
	
	
}
